package com.hup.utils.io.socket.udp;

import lombok.Getter;

import java.net.InetAddress;

/**
 * @author hugan
 * @date 2020/3/29
 */
public class UdpData {

    @Getter
    private final byte[] data;
    @Getter
    private final InetAddress address;
    @Getter
    private final int port;

    public UdpData(byte[] data, InetAddress address, int port) {
        this.data = data;
        this.address = address;
        this.port = port;
    }

    public String print() {
        return "dataSize=" + data.length
                + ", from=" + address.toString()
                + ", port=" + port;
    }

}
